home *** CD-ROM | disk | FTP | other *** search
- Subject: Promises, Promises
- Sent: 3/29/96 5:02 PM
- Received: 3/29/96 4:11 PM
- From: Nolan Larsen, nlarsen@itsnet.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- ODF Team,
- ODF places a promise on the clipboard when a selection object is cut or
- copied to the clipboard. This does not work for text. Let me give you an
- example:
-
- When a paragraph of text is selected to be cut or copied and the cut or
- copy command is issued, the following method in FWSelect.cpp is called:
-
-
- void FW_CSelection::PrivHandleExternalizeSelection(Environment* ev,
-
- FW_EStorageKinds storageKind,
-
- ODStorageUnit* destinationSU,
-
- FW_CCloneInfo* cloneInfo)
- {
- // ----- Add the needed properties first -----
- GetPart(ev)->AddProperties(ev, destinationSU);
-
- ODUpdateID updateID = 0;
-
- GetPart(ev)->DeletePromise(ev, storageKind);
-
- if (storageKind == FW_kClipboardStorage)
- updateID = GetSession(ev)->GetClipboard(ev)->GetUpdateID(ev);
-
- FW_CPromise* promise = NewPromise(ev, updateID, storageKind,
-
- cloneInfo->GetScopeFrame(ev),
-
- cloneInfo->GetCloneKind(ev));
-
- if (promise)
- {
- GetPart(ev)->SetPromise(ev, promise);
- promise->PromisePropertiesAndValues(ev, destinationSU);
- }
- else
- {
- this->DoExternalizeSelection(ev, destinationSU, cloneInfo);
- }
-
-
- I have overwritten the DoExternalizeSelection method to externalize the
- selected paragraph but my method is not called in response to the cut or
- copy command, instead a promise is written to the clipboard.
-
- Now the user repositions the insertion point to another location in the
- document and selects the paste command. At this point my
- DoExternalizeSelection method is called to fulfill the promise. The only
- problem is that the promised selection is lost when the user repositioned
- the cursor and there is no way for me to fulfill the promise.
-
- How can I get ODF to call my method directly when cut or copy is invoked
- rather than writing a promise to the clipboard?
-
- BTW, Why are there hard coded interface strings in the DoIt method of
- FWEdCmd.cpp?
-
- Thanks,
- Nolan Larsen
- nlarsen@itsnet.com
-
-